- content_for :extra_javascript do
  :javascript
    $(document).ready(function() {
      window.ST.initialize_new_listing_form_selectors(#{raw @listing_presenter.new_listing_form.to_json});
    });

- content_for :extra_javascript do
  - maps_key = MarketplaceHelper.google_maps_key(@current_community.id)
  - key_param = maps_key ? "?key=#{maps_key}" : ""
  - needs_maps = !FeatureFlagHelper.feature_enabled?(:topbar_v1) || search_mode == :keyword
  = javascript_include_tag "//maps.googleapis.com/maps/api/js#{key_param}" if needs_maps

- if @listing_presenter.acts_as_person
  - content_for :banner_warning do
    = t('.you_are_now_posting_a_listing_on_behalf_of', name: @listing_presenter.new_listing_author.full_name)

- content_for :title_header do
  %h1= t("homepage.index.post_new_listing")
#new_listing_form.new-listing-form.centered-section

  #selected-groups

    - if @listing_presenter.categories.size >= 1
      .selected-group{:name => "category"}
        - @listing_presenter.categories.each do |value|
          %a.select.selected.hidden{:data => {:id => value.id}}
            .link-text= t(".selected_category", :category => value.display_name(I18n.locale))

    - if @listing_presenter.subcategories.size >= 1
      .selected-group{:name => "subcategory"}
        - @listing_presenter.subcategories.each do |value|
          %a.select.selected.hidden{:data => {:id => value.id}}
            .link-text= t(".selected_subcategory", :subcategory => value.display_name(I18n.locale))

    - if @listing_presenter.shapes.size >= 1
      .selected-group{:name => "listing_shape"}
        - @listing_presenter.shapes.each do |value|
          %a.select.selected.hidden{:data => {:id => value[:id]}}
            .link-text= t(".selected_transaction_type", :transaction_type => t(value[:name_tr_key]))

  %h2.listing-form-title{:id => "foo"}

  #option-groups

    - if @listing_presenter.categories.size >= 1
      .option-group{:name => "category"}
        - @listing_presenter.categories.each do |value|
          %a.select.option.hidden{:data => {:id => value.id}}
            .link-text= value.display_name(I18n.locale)

    - if @listing_presenter.subcategories.size >= 1
      .option-group{:name => "subcategory"}
        - @listing_presenter.subcategories.each do |value|
          %a.select.option.hidden{:data => {:id => value.id}}
            .link-text= value.display_name(I18n.locale)

    - if @listing_presenter.shapes.size >= 1
      .option-group{:name => "listing_shape"}
        - @listing_presenter.shapes.each do |value|
          %a.select.option.hidden{:data => {:id => value[:id]}}
            .link-text= t(value[:name_tr_key])

  .js-form-fields.hidden
